package com.freeLearning.boot.system.service.impl;

import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.freeLearning.boot.system.mapper.ConsultantAuditMapper;
import com.freeLearning.boot.system.model.bo.UserBO;
import com.freeLearning.boot.system.model.entity.ConsultantAudit;
import com.freeLearning.boot.system.model.query.ConsultantAuditPageQuery;
import com.freeLearning.boot.system.model.vo.ConsultantAuditPageVO;
import com.freeLearning.boot.system.service.ConsultantAuditService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

@Service
@RequiredArgsConstructor
public class ConsultantAuditServiceImpl extends ServiceImpl<ConsultantAuditMapper, ConsultantAudit> implements ConsultantAuditService {
    private final ConsultantAuditMapper consultantAuditMapper;
    @Override
    public IPage<ConsultantAuditPageVO> getPage(ConsultantAuditPageQuery consultantAuditPageQueryParams) {
        // 参数构建
        int pageNum = consultantAuditPageQueryParams.getPageNum();
        int pageSize = consultantAuditPageQueryParams.getPageSize();
        Page<UserBO> page = new Page<>(pageNum, pageSize);
        return this.consultantAuditMapper.getPage(page, consultantAuditPageQueryParams);
    }
}
